package com.example.hotHub.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ListData<T> {

    private Long total;

    private List<T> list;

    public ListData (List<T> list) {
        this.total = list.stream().count();
        this.list = list;
    }

}
